package cn.itcast.controller;

import cn.itcast.entity.Account;
import cn.itcast.service.AccountService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/account")
public class AccountController {
    @Autowired
    AccountService accountService;

    @GetMapping("/findAll")
    public List<Account> findAll(){
        List<Account> accountList = accountService.findAll();
        log.info("日志打印测试{}",accountList);
        return accountList;
    }
}
